package com.sicau.tools;

import jakarta.annotation.Resource;
import org.springframework.ai.support.ToolCallbacks;
import org.springframework.ai.tool.ToolCallback;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class ToolRegister {

    @Value("${baidu.access-key}")
    private String ACCESS_KEY;
    @Resource
    private RestTemplate restTemplate;
    @Resource
    private QQEmailTool qqEmailTool;
    @Resource
    private DocumentRetrieverTool documentRetrieverTool;

    @Bean
    public ToolCallback[] allTools() {
        return ToolCallbacks.from(
            new WebSearchTool(restTemplate, ACCESS_KEY),
            new WebScrapingTool(),
            new PdfGenerateTool(),
            new ResourceDownloadTool(),
            new FileOperationTool(),
            new TerminalOperationTool(),
            new DatetimeQueryTool(),
            new TerminateTool(),
            // qqEmailTool,
            documentRetrieverTool
        );
    }
}
